home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1996 #6 / Amiga Plus CD - 1996 - No. 06.iso / pd / netz / amigancp1.8 / docs / amigancp.doc next >
Text File  |  1996-08-10  |  60KB  |  1,903 lines

  1.  
  2.  
  3. AmigaNCP
  4. ********
  5.  
  6. Welcome to the AmigaNCP package, the AmigaOS implementation of
  7. Psion's NCP network protocol.
  8.  
  9. Copyright
  10. *********
  11.  
  12. This is a limited demonstration copy of the AmigaNCP package.  You
  13. may test it for up to 30 days.  If you like it, fill in the order form
  14. and send it to
  15.  
  16.      Oliver Wagner
  17.      Märkische Str. 24
  18.      D-42281 Wuppertal
  19.      Germany
  20.      
  21.      email: owagner@vapor.com
  22.  
  23. Payment may only be included cash or in form of a properly filled in
  24. euro cheque (with DM as currency).
  25.  
  26. In reply we will send you the full version.
  27.  
  28. The AmigaNCP package has been written by
  29.  
  30.      Oliver Wagner
  31.      Märkische Str. 24
  32.      42281 Wuppertal
  33.      Germany
  34.      
  35.      email: owagner@vapor.com
  36.  
  37. The AmigaNCP driver library, the AmigaNCP File Server, the AmigaNCP
  38. File System, the AmigaNCP Documentation and all associated files are
  39. copyright (C) 1993-1996 Oliver Wagner, All Rights Reserved.
  40.  
  41.     Psion, the Psion Logo, Psion Series 33-LinkPsion HC,
  42. Psion MCSSD and Solid State Disk are registered Trademarks of
  43. Psion PLC.
  44.  
  45. The author wishes to thank the following people for their help during
  46. AmigaNCP development:
  47.  
  48. David Wood of Psion Ltd.
  49.      Who provided the necessary information about the NCP protocol and
  50.      helped with beta testing the package
  51.  
  52. Jeremy "Jezar" Wakefield of Psion Ltd.
  53.      Who helped to track down several hidden and esoteric bugs.
  54.  
  55. Eric (ed@ramses.fdn.org)
  56.      For providing the french catalog translation.
  57.  
  58. Phil Trickett (phil@dcs.king.ac.uk)
  59.      For the additional icon images.
  60.  
  61. Introduction
  62. ************
  63.  
  64. Overview
  65. ========
  66.  
  67. Psion's fine palmtop computer series, namely the S3 and S3a,
  68. contain an even finer operating system, whose neat features cover a full
  69. fledged peer-to-peer networking software using a protocol called
  70. NCP.
  71.  
  72. Using NCP, you can link together two Psion computers or a Psion and a
  73. different, perhaps stationary machine and happily exchange data on your
  74. behalf.  NCP services include, but are not limited to, accessing files
  75. on the remote machines as if they were on yours, in both directions.
  76.  
  77. Linking your palmtop to your stationary machine is generally quite a
  78. good idea.  Doing so via the NCP protocol requires your stationary
  79. machine to have an implemention of this protocol.  There have only been
  80. implementations for MS-DOS clones (the MCLINK.EXE shell), for Apple
  81. MacIntosh and for Acorn Archimedes - until now.
  82.  
  83. AmigaNCP features a full NCP implementation including a remote file
  84. server to access Amiga files from your Psion and a file system to access
  85. Psion files from your Amiga.  The package also offers an API to allow
  86. custom applications to directly access network services at the NCP
  87. level.
  88.  
  89. Parts of AmigaNCP
  90. =================
  91.  
  92. AmigaNCP actually consists of several different programs.
  93.  
  94. The main part is the amigancp.library.  It contains the basic network
  95. services for exchanging data between two machines via a serial
  96. connection.  The protocol provides up to 8 data channels, which can be
  97. either passive (awaiting a connection from a client process) or active
  98. (attempting to connect to a server process).  One of the channels is
  99. reserved for the network supervisor application LINK.  The LINK
  100. functionality also has been integrated into amigancp.library.
  101.  
  102. Besides network I/O functions, the library also provides several
  103. utility functions to deal with Psion text format and the Intel byte
  104. ordering.
  105.  
  106. The AmigaNCP-FileServer is an application built on top of
  107. amigancp.library.  It provides a means of accessing AmigaDOS
  108. files from the remote Psion computer via the REM:: file system.  This
  109. allows you to access Amiga files just as if they were local Psion
  110. files.  With the Psion S3a, it allows you to use the Backup option to
  111. backup vital data files on your Amiga's harddisk.
  112.  
  113. The AmigaNCP-FileSystem uses the amigancp.library to connect to
  114. the file server running on your Psion in order to provide access to
  115. Psion files from the AmigaDOS environment.  It provides a new AmigaDOS
  116. device named NCP: which offers access to all available Psion devices.
  117. The Psion devices will be mounted as subdirectories in the NCP:
  118. window.
  119.  
  120. The AmigaNCP-Monitor monitors the activity of the NCP supervisor and
  121. gives detailed statistics about all channels.  This is an invaluable
  122. aid for debugging NCP applications.
  123.  
  124. The S3PrintServer allows you to print from your S3 or S3a directly to
  125. a printer connected to the Amiga.
  126.  
  127. The S3Run program remotely launches programs or applications on your
  128. Psion.
  129.  
  130. Using AmigaNCP
  131. **************
  132.  
  133. Installation
  134. ============
  135.  
  136. For using AmigaNCP you'll need...
  137.  
  138.   1. any Amiga equipped with OS 2.04 or better and a free serial port
  139.  
  140.   2. the IBM-PC version of the 3-Link serial cable
  141.  
  142.   3. and a Psion S3 or S3a (or any other model featuring Remote
  143.      Link)(1).
  144.  
  145.  
  146. To support Amiga systems without a hard disk, the AmigaNCP distribution
  147. has been organized to be ready-to-use.
  148.  
  149. Hard disk installation of AmigaNCP is best done using the provided
  150. Installer script.  The script will (by default) copy
  151. amigancp.library to LIBS:, put the language catalogs into
  152. LOCALE:Catalogs/ and create an AmigaNCP drawer on your work
  153. partition.  The drawer will contain the network services, documentation
  154. and the NCP tools.  There's an additional option for installing the
  155. amigancp.library developer material.
  156.  
  157. When installing the package for the first time, the installation
  158. procedure will ask you about the Psion model you're going to connect
  159. to.  The serial line speed will be set to the model's maximum (that is
  160. 9600 baud for the S3 or HC and 19200 baud for S3a or MC). You may
  161. change the serial parameters later on, though.
  162.  
  163. Configuring amigancp.library
  164. ============================
  165.  
  166. The default serial configuration is to use the serial.device, unit 0,
  167. at 9600 baud(2).
  168.  
  169. You can overwrite these default parameters by setting or changing the
  170. environment variable NCP.config.  The environment variable will be
  171. read by the amigancp.library each time a serial connection has to be
  172. established.
  173.  
  174. The parameter parsing is done just like in a shell command line; the
  175. template is D=DEVICE/K, U=UNIT/K/N, B=BAUD/K/N, NOREQ/S.  All
  176. parameters are optional, those not given will retain their default
  177. values.
  178.  
  179. An example:  To make AmigaNCP use duart.device, unit 1 at 19200 baud
  180. you have to set ENV:NCP.config to
  181.  
  182.     DEVICE=duart.device UNIT=1 BAUD=19200
  183.  
  184. The installation script will create both ENV:NCP.config and
  185. ENVARC:NCP.config with either
  186.  
  187.     DEVICE=serial.device UNIT=0 BAUD=9600
  188.  
  189. or
  190.  
  191.     DEVICE=serial.device UNIT=0 BAUD=19200
  192.  
  193. depending on your choice of Psion model.  Please note, that you may
  194. actually use any baud rate supported by the serial port in question
  195. (and of course supported by the other side's serial interface as well).
  196.  
  197. If you set the NOREQ switch, the library will not display any error
  198. requesters.
  199.  
  200. Note that you have to configure the remote site as well.  On the Psion
  201. S3 or S3a this consists of turning on NCP via the Remote Link menu of
  202. the system screen.  The baud rate must of course be set to the same
  203. value as used in ENV:NCP.config, or to 9600 if no configuration file
  204. exists.
  205.  
  206. Starting AmigaNCP
  207. =================
  208.  
  209. You don't start amigancp.library directly.  Instead you start one or
  210. more of the AmigaNCP applications, which in turn will open the library
  211. and try to establish their connections to the remote NCP site.
  212.  
  213. The library automatically terminates a connection about 10 seconds
  214. after the last application has closed its network channels.
  215.  
  216. Note that the underlying serial device is free to be used by any other
  217. application as long as no NCP connection is active and no connection
  218. attempt is made.
  219.  
  220. NCP Requesters
  221. ==============
  222.  
  223. The amigancp.library will put up error requesters if the network link
  224. breaks (and the NOREQ switch hasn't been set, see above).  The
  225. following table shows possible error conditions:
  226.  
  227. Can't open serial device
  228.      The device specified in ENV:NCP.config could not be opened.
  229.      Either the device does not exist (perhaps just because you
  230.      misspelled the device name) or it is in use by another process.
  231.  
  232. Timeout waiting for response
  233.      The serial device opened ok but the other side is not responding
  234.      to our handshake packet.  Most likey there is no Psion connected,
  235.      or it has it's Remote Link turned off.  This requester will
  236.      constantly show up if the AmigaNCP file system is running and the
  237.      serial link broke down.
  238.  
  239. Data not acknowledged
  240.      The last data packet has not been acknowledged.  This normally
  241.      denotes an NCP connection which has been interrupted during data
  242.      transfer.
  243.  
  244. Connection dropped
  245.      The remote side dropped the connection.
  246.  
  247. Argument error
  248.      Bad LLMAC request arguments.  You normally should not see this
  249.      error, it denotes an internal failure in the amigancp.library
  250.      high level I/O functions.
  251.  
  252. Not connected
  253.      There is no LLMAC connection.  You normally should not see this
  254.      error, it denotes an internal failure in the amigancp.library
  255.      high level I/O functions.
  256.  
  257. ---------- Footnotes ----------
  258.  
  259. (1)  In fact of course any NCP implementation does.  You can use
  260. AmigaNCP to connect to an NCP server running on an IBM PC or Apple Mac,
  261. or even to another AmigaNCP running on a different Amiga.
  262.  
  263. (2)  All other serial flags are fixed to 8N1, highspeed mode and 7-wire
  264. RTS/CTS handshake since this is required by the NCP protocol.
  265.  
  266. AmigaNCP File Server
  267. ********************
  268.  
  269. Introducing the File Server
  270. ===========================
  271.  
  272. The AmigaNCP File Server is an NCP application which provides access
  273. to Amiga files from the remote machine.  On startup it creates a
  274. passive NCP channel awaiting a connection from a remote file system.
  275.  
  276. On the S3 and S3a, the remote file system is built into the ROM.  It
  277. automatically attempts to connect to the remote file server when an NCP
  278. connection is made, and presents a new filesystem node named REM::,
  279. which in turn contains all the Amiga devices.  You can navigate through
  280. the Amiga devices via the system screen or directly access a file by
  281. it's full path name.
  282.  
  283. The Psion's file system was designed to be device independant, so there
  284. are no restrictions concerning the length of file names or extensions:
  285. The complete Amiga device, directory and file names are fully
  286. preserved.  However, directories are separated in the standard Psion
  287. manner via the \ character.
  288.  
  289. An example:  To access the Amiga file HD1:Test/Test.txt from the
  290. Psion, use the file name REM::HD1:\TEST\TEST.TXT.  To access
  291. SYS:S/Startup-Sequence, use REM::\SYS:\STARTUP-SEQUENCE.
  292.  
  293. When asked for a device list, the AmigaNCP File Server will output only
  294. real file system devices(1).  However, you may in fact access any
  295. AmigaDOS device, even volumes and assigned names, from the remote site
  296. by using the direct path to it.
  297.  
  298. An example:  To access the Amiga's parallel port from the remote site,
  299. just use the path REM::PAR:\.  This is quite useful for using the
  300. print-to-file capabilities of some of the Psion applications.
  301.  
  302. Character conversion mode
  303. =========================
  304.  
  305. Since the Psion's operating system uses a different character codeset
  306. than the Amiga does, you normally can't easily exchange ASCII files
  307. between the two machines.  The AmigaNCP File Server however provides a
  308. special conversion mode which allows to convert files on the fly.
  309.  
  310. Whenever you add the special extension .CV to any remote file name,
  311. all characters read from or written to that file will
  312. automatically be converted by AmigaNCP.  The conversion is fully
  313. transparent to your applications.
  314.  
  315. An example:  To edit the Amiga text file HD1:Test/Test.TXT on the S3
  316. with automatic character conversion, use the virtual file name
  317. REM::HD1:\TEST\TEST.TXT.CV.
  318.  
  319. Note that character conversion mode should be used only for text
  320. files.  The S3 and S3a Word file format for example contains binary
  321. data which will be gracefully mangled if accessed in conversion mode.
  322.  
  323. File Server Options
  324. ===================
  325.  
  326. The AmigaNCP File Server may be started either from the shell or from
  327. Workbench.  To terminate the server, just start it again, it will put
  328. up a requester showing you the number of files in use and asking you
  329. whether you really want to quit.
  330.  
  331. The File Server accepts several options to modify the way it operates.
  332. Note that you have to set up amigancp.library first (See Using
  333. AmigaNCP.).
  334.  
  335. Options may be given on the command line (shell) or using tooltype
  336. entries (Workbench).  You may use project icons to start the File
  337. Server in order to have different configurations at hand.
  338.  
  339. The option template is:
  340.          IBM=CHARSETCONV/S,
  341.      SHOWICONS=SHOWINFO/S,
  342.      HIDEEMPTYDRIVES/S,
  343.      BUFFER=BUFFERSIZE
  344. You may enter ? to get additional help at the command line.  Detailed
  345. parameter descriptions follow.
  346.  
  347. CharSetConv
  348. -----------
  349.  
  350. When the remote file system requests a directory scan, the file server
  351. examines each file to determine whether it is a text file or not(2).
  352. Text files are then returned both with their normal name and with the
  353. magic extension .CV added.
  354.  
  355. ShowInfo
  356. --------
  357.  
  358. Show *.info and .backdrop files during a directory scan.  You
  359. normally shouldn't set this option, the Psion has no use for these
  360. files and directory scans are much faster without them.
  361.  
  362. Please note that the Psion's Delete Whole Directory function will
  363. only work correctly on Amiga directories if ShowInfo has been enabled.
  364.  
  365. HideEmptyDrives
  366. ---------------
  367.  
  368. Upon a device list query, don't return drives which currently do not
  369. contain a medium.  This option is intended mainly to overcome an
  370. annoying quirk in the S3 and S3a system screen which resets the current
  371. device to LOC::\M\ each time a device reports E_NOT_READY.  This
  372. normally always happens when getting to REM::DF0: with no disk in the
  373. drive.
  374.  
  375. Note that, although these devices are not visible in the device list,
  376. they may as usual be accessed by manually entering the device name.
  377.  
  378. BufferSize
  379. ----------
  380.  
  381. Set the size of the filehandle buffers used by the File Server.  This
  382. parameter defaults to 4096 Bytes and normally doesn't need to be
  383. changed(3).
  384.  
  385. ---------- Footnotes ----------
  386.  
  387. (1)  Tech info:  Any device which responds positively to
  388. ACTION_IS_FILESYSTEM is considered to be a real file system.
  389.  
  390. (2)  Tech info:  This is done by reading the first 512 Bytes and
  391. scanning them for non-printable characters.  Files with the S
  392. protection bit set are always assumed to be text files.
  393.  
  394. (3)  This option has no effect on AmigaOS below version 3.1
  395.  
  396. AmigaNCP File System
  397. ********************
  398.  
  399. Introducing the File System
  400. ===========================
  401.  
  402. The AmigaNCP File System is an NCP application which provides access
  403. from the AmigaDOS environment to files on the remote machine.  It
  404. creates a new AmigaDOS device named NCP:, which in turn contains all
  405. remote devices as subdirectories.
  406.  
  407. The Amiga directory NCP:A refers to the device A: on the remote
  408. side, NCP:M refers to M: and so on.
  409.  
  410. If you want to access any file on the remote device, just add the full
  411. path name.  To access the file A:\WRD\SECRET.WRD, just use the Amiga
  412. file name NCP:A/WRD/SECRET.WRD.
  413.  
  414. You can access the new device from any Amiga application, including
  415. Workbench and your favourite directory tool, as if they were standard
  416. Amiga files.
  417.  
  418. On startup, the AmigaNCP File System immediately attempts to connect to
  419. the File Server on the remote machine.  If no connection can be made,
  420. the File System will refuse to start.  You may attempt to quit it at
  421. any time by starting it again, however, due to AmigaDOS constraints it
  422. will refuse to quit if there are any files or locks still in use.
  423.  
  424. Character Conversion Mode
  425. =========================
  426.  
  427. The AmigaNCP File System also features the character conversion mode.
  428. If you enable this option, all remote devices will be mirrored as
  429. CONV_<devname>, and all characters read from or written to files
  430. within these subdirectories will automatically be converted.
  431.  
  432. Example:  To access A:\WRD\SECRET.TXT with character conversion, use
  433. the file name NCP:CONV_A/WRD/SECRET.TXT.
  434.  
  435. The translation is fully transparent; you may, for example, use your
  436. favourite text editor to load a text file from the Psion, edit it and
  437. save it again.  Upon reading, it will be converted to the Amiga ISO
  438. character set, upon writing, it will be converted back to the IBM codes
  439. used by the Psion.
  440.  
  441. File System Options
  442. ===================
  443.  
  444. The File System accepts several options to modify the way it operates.
  445. Note that you have to set up amigancp.library first (See Using
  446. AmigaNCP.).
  447.  
  448. Upon shell startup, options are specified on the command line.  The
  449. template is:
  450.          VOL=VOLUMENAME/K,
  451.      DEV=DEVICENAME/K,
  452.      SR=SHAREDREAD/S,
  453.      IBM=CHARSETCONV/S,
  454.      HED=HIDEEMPTYDRIVES/S,
  455.      DWMS=DONTWARNMISSINGSERVER/S,
  456.      ARR=AUTOREREAD/S,
  457.      ID=ICONDIR/S
  458. You may enter ? to get additional help at the command line.  See
  459. below for detailed descriptions of these parameters.
  460.  
  461. If started from Workbench, the File System application will read its
  462. icon and parse the tooltypes for the same option keywords.  You may use
  463. project icons for starting the File System in order to have different
  464. configurations at hand.
  465.  
  466. VolumeName
  467. ----------
  468.  
  469. This options allows you to set the volume node name of the File System.
  470. Defaults to AmigaNCP-Remote.  This is the name the Workbench shows
  471. below the disk icon.
  472.  
  473. DeviceName
  474. ----------
  475.  
  476. Modifies the device name of the File System.  Defaults to NCP:.
  477.  
  478. SharedRead
  479. ----------
  480.  
  481. For historical reasons, there is no real read only mode in the
  482. AmigaDOS.  The access mode MODE_OLDFILE can be used for reading and
  483. writing an existing file from multiple accessors.  So an Amiga file
  484. system cannot predict whether a file opened with MODE_OLDFILE will
  485. also be written to.
  486.  
  487. The Psion filing system however limits multiple file access to read
  488. only mode.
  489.  
  490. To be as compatible as possible with existing Amiga applications, the
  491. AmigaNCP File System by default translates MODE_OLDFILE to exclusive
  492. read/write access on the Psion.
  493.  
  494. This may cause problems if a file is already opened for reading from
  495. the Psion side, perhaps because you have a Psion application running
  496. which accesses this file.  Even a read only access from the Amiga side
  497. will fail because it translates to a read/write access on the Psion
  498. side.
  499.  
  500. In order to overcome this AmigaDOS quirk, the AmigaNCP File System
  501. provides this option to translate MODE_OLDFILE to a shared read
  502. access on the Psion side.  Every write attempt on such a file will
  503. result in a ERROR_WRITE_PROTECTED.
  504.  
  505. CharSetConv
  506. -----------
  507.  
  508. Activate character conversion mode.  All Psion devices are mirrored as
  509. CONV_<devname and read/write accesses to files within these drawers
  510. are silently translated.
  511.  
  512. Note that file handles opened in character conversion mode don't
  513. support ACTION_SEEK.  This may cause problems with some applications.
  514.  
  515. HideEmptyDrives
  516. ---------------
  517.  
  518. Don't create subdirectories for Psion devices which don't contain a
  519. medium.
  520.  
  521. DontWarnMissingServer
  522. ---------------------
  523.  
  524. The File Server should normally be started first, because the Psion
  525. LINK application attempts to contact it as soon as the connection has
  526. been established, and it will not try again if no connection could be
  527. made.
  528.  
  529. Therefore, the File System will warn you with a requester if it can't
  530. detect the AmigaNCP File Server when it is started.  Setting this option
  531. instructs the File System not to do so.
  532.  
  533. AutoReRead
  534. ----------
  535.  
  536. By default, the File System reads the remote device list only once at
  537. the time it is started.
  538.  
  539. This should normally be no problem, unless you use HideEmptyDrives
  540. and replace SSD cartridges while a connection is active.
  541.  
  542. You can use DiskChange NCP: at any time to manually force the File
  543. System to read the device list again.  Or you can set AutoReRead,
  544. which causes the File System to read the device list from the remote
  545. side upon every access, which of course will slow accesses down a bit.
  546.  
  547. IconDir
  548. -------
  549.  
  550. In order to be compatible with the Workbench environment, the File
  551. System stores icon and workbench information files (.info and
  552. .backdrop) in a special file hierarchy on the AmigaDOS side.
  553. This allows you to do snapshoting and backdroping of icons belonging to
  554. Psion files without wasting valuable storage memory on the Psion.  This
  555. also avoids the problem that the Psion file system can't handle file
  556. extensions longer than three characters.
  557.  
  558. The default path for storing these files is the drawer Icons in the
  559. subdirectory where the File System program resides.  Using the
  560. IconDir option, you can specify another path.  This is quite
  561. useful if you use AmigaNCP to connect to different Psions with
  562. different file structures.
  563.  
  564. The file structure inside this IconDir drawer is organized exactly like
  565. in the NCP: device.  So, a icon file belonging to WRD drawer on the
  566. M device on the Psion is located in Icons/M/WRD.info.
  567.  
  568. Implementation Details
  569. ======================
  570.  
  571. The AmigaNCP File System supports the following AmigaDOS packet types:
  572.  
  573.    * ACTION_IS_FILESYSTEM
  574.  
  575.    * ACTION_FLUSH
  576.  
  577.    * ACTION_DISK_INFO
  578.      The resulting disk sizes are calculated by adding the per-device
  579.      sizes of the underlying Psion devices.
  580.  
  581.    * ACTION_INFO
  582.  
  583.    * ACTION_COPY_DIR
  584.  
  585.    * ACTION_COPY_DIR_FH
  586.  
  587.    * ACTION_LOCATE_OBJECT
  588.  
  589.    * ACTION_FREE_LOCK
  590.  
  591.    * ACTION_EXAMINE_FH
  592.  
  593.    * ACTION_EXAMINE_OBJECT
  594.  
  595.    * ACTION_EXAMINE_NEXT
  596.      Psion directory lists are read completly on the first EXNEXT
  597.      packet and kept in a private cache of the lock. This results in a
  598.      ExAll() like performance even with using the old style directory
  599.      scanning packets.
  600.  
  601.    * ACTION_CURRENT_VOLUME
  602.  
  603.    * ACTION_SAME_LOCK
  604.  
  605.    * ACTION_CREATE_DIR
  606.  
  607.    * ACTION_PARENT
  608.  
  609.    * ACTION_PARENT_FH
  610.  
  611.    * ACTION_DELETE_OBJECT
  612.  
  613.    * ACTION_RENAME_OBJECT
  614.      Note that renaming an non-icon file to an icon-file will yield
  615.      ERROR_RENAME_ACROSS_DEVICES.
  616.  
  617.    * ACTION_DIE
  618.  
  619.    * ACTION_FINDINPUT
  620.      See the description of the SharedRead option for differen
  621.      translation modes.
  622.  
  623.    * ACTION_FINDOUTPUT
  624.  
  625.    * ACTION_FINDUPDATE
  626.      This always translates to exclusive access on the Psion side.
  627.  
  628.    * ACTION_INHIBIT
  629.  
  630.    * ACTION_END
  631.  
  632.    * ACTION_READ
  633.  
  634.    * ACTION_WRITE
  635.  
  636.    * ACTION_SEEK
  637.      Not available on files opened in character conversion mode.
  638.  
  639.    * ACTION_SET_PROTECT
  640.      Supports FIBF__ARCHIVEFIBF_READFIBF_WRITE  and
  641.      FIBF_EXECUTE.
  642.  
  643.    * ACTION_SET_DATE
  644.  
  645. Other Tools
  646. ***********
  647.  
  648. The AmigaNCP package contains a few more programs which are meant for
  649. the advanced user.  Since they are also good examples for how to access
  650. the amigancp.library, the source code for most of these utilities can
  651. be found in the Developer/Source/ drawer.
  652.  
  653. AmigaNCP-Monitor
  654. ================
  655.  
  656. The AmigaNCP-Monitor is a utility for monitoring the current network
  657. activity.  It displays an overview over the eight avaible NCP channels,
  658. their users, current connection states and the amount of data that has
  659. been transferred.
  660.  
  661.     AmigaNCP-Monitor may be started either from the shell or from
  662. Workbench.  There are no additional parameters.  The window position
  663. will be saved as a tooltype entry.
  664.  
  665. The Monitor opens a single window on the workbench screen.  The top
  666. part displays the states of the eight network channels, the bottom part
  667. shows overall statistics and whether NCP is currently connected.
  668.  
  669. ThisProc
  670.      The network name of the Amiga process using the channel.  The
  671.      first channel is always allocated by the LINK application.
  672.  
  673. RemotePr
  674.      The name of the remote process.  This may be empty, meaning the
  675.      channel is currently not connected.
  676.  
  677.          UnknClnt identifies a passive channel connected to an
  678.      unknown client.
  679.  
  680.      For the first channel, this may be either ARemLink, denoting
  681.      that the current connection has been initiated by the remote link,
  682.      or PRemLink, if the current connection was opened on behalf of
  683.      the amigancp.library.
  684.  
  685. Status
  686.      This flag array denotes various internal states of
  687.      amigancp.library.
  688.  
  689. Bytes Sent
  690.      How many bytes have been sent through this channel?
  691.  
  692. Bytes Received
  693.      How many bytes have been received through this channel?
  694.  
  695. Online since
  696.      The time on which amigancp.library was started first.  The
  697.      startup time is used by the NCP protocol to determine whether a
  698.      broken connection can be reestablished or not.
  699.  
  700. Remote NCP
  701.      The remote NCP's startup time.
  702.  
  703. Version
  704.      The remote NCP's version.  This is generally 2 for AmigaNCP and
  705.      the Psion S3 and 3 for the S3a.
  706.  
  707. Connected
  708.      This will be displayed whenever there is an active connection to
  709.      any remote NCP.
  710.  
  711. S3PrintServer
  712. =============
  713.  
  714. The S3PrintServer is a small utility which allows you to print from
  715. your Psion directly to a printer connected to the Amiga.  It uses the
  716. Psion's capability to print to a serial printer, and simply passes any
  717. data from the serial port directly to the printer device via raw writes.
  718.  
  719. You have to turn off the Remote Link on the Psion side and terminate
  720. any NCP application running on the Amiga side before starting the
  721. S3PrintServer.  If you forget to turn off the Remote Link, junk will
  722. be printed due to misinterpreted NCP packets!
  723.  
  724. You must also set your Psion's printer configuration to serial
  725. printing, with the same baud rate used for NCP connections, turn off
  726. Xon/Xoff and turn on RTS/CTS and DSR/DTR handshaking.  The
  727. S3PrintServer itself reads the serial configuration from the file
  728. ENV:NCP.config.
  729.  
  730. The S3PrintServer uses the raw write capabilities of the
  731. printer.device and therefore ignores any printer driver settings.
  732. However, it respects your choice on which device to print, and even
  733. allows printing via network printer services, e.g.  Envoy Network
  734. Printing.
  735.  
  736. Therefore, you must select the correct WDR printer driver on the
  737. Psion.  This can be done in the Printer Setup dialog of the
  738. Word application.
  739.  
  740. Having done all this, you can print from your Psion applications simply
  741. by selecting the Print... menu, just as if the printer was connected
  742. directly to the Psion.
  743.  
  744. S3Run
  745. =====
  746.  
  747. The S3Run utility uses the LINK application's capability to launch
  748. a process on the remote side.  It's a shell only program which takes
  749. one or two parameters: S3Run filename commandline
  750.  
  751. The first argument denotes the file name of the remote program to run,
  752. for example TEST.IMG.  Due to NCP restrictions, this may only be a
  753. program on the Psion's top level directory or ROM.
  754.  
  755. The second argument may contain the command line to be passed to the
  756. created process.  This argument may be omitted, in which case no command
  757. line will be passed.
  758.  
  759. You may use \xx escaping to insert the hexadecimal code xx into
  760. the command line.  See `the Psion SIBO SDK Manual' for more information
  761. on S3 command lines.
  762.  
  763. API
  764. ***
  765.  
  766. This part of the AmigaNCP documentation describes the use of AmigaNCP
  767. services within custom applications.  It assumes a broad knowledge of
  768. programming AmigaOS.
  769.  
  770. NCP Implementation
  771. ==================
  772.  
  773. The Psion NCP network protocol consists of four layers:
  774.  
  775. Serial Layer
  776.      A simple asynchronous serial 8/N/1 connection.  This is in fact
  777.      the hardware serial connection built into the 3-Link.
  778.  
  779. Packet Layer
  780.      A packet protocol providing checksums and multiple
  781.      retransmissions.  It is called LLMAC and somewhat based on the
  782.      MNP type protocols.
  783.  
  784. NCP Layer
  785.      NCP provides up to eight independant data streams between local
  786.      and remote processes.  Under the Psion OS, a process may use only
  787.      one NCP channel at a time.
  788.  
  789. Application Layer
  790.      Applications built on top of the NCP data stream service.  This
  791.      includes the remote file system and remote file server.  There is
  792.      also a supervisory application called LINK which controls the
  793.      server setup.
  794.  
  795. A more detailed description of NCP usage from the Psion side can be
  796. found in the `Psion SIBO SDK Manual, I/O Devices Reference'.
  797.  
  798. On the Amiga side, the serial layer is provided through any standard
  799. EXEC serial device, normally this will be the internal port's
  800. serial.device.  The packet and NCP layers have been built into
  801. the amigancp.library.
  802.  
  803. Besides these basic layers, also the supervisory LINK application
  804. resides in the
  805.     amigancp.library.
  806.  
  807. All network services are accessible via function calls to the
  808. amigancp.library.  In order to use these functions, you have to
  809. open the amigancp.library first:
  810.  
  811.          #include <libraries/ncp.h>
  812.      
  813.          struct Library *NCPBase;
  814.          NCPBase = OpenLibrary( "amigancp.library", NCP_VERSION );
  815.          if( !NCPBase )
  816.              fail_app();
  817.  
  818. If you use SAS/C 6.50 or above, you may want to use the link library
  819. ncp.lib provided in the development toolkit.  It contains a
  820. constructor/destructor pair that automatically opens/closes the
  821. amigancp.library upon startup/termination of your application.
  822.  
  823. If you are not using C, you'll have to build your own language specific
  824. glue definitions.  A function description file
  825. (Developer/FD/ncp_lib.fd) has been included.  The AmigaNCP
  826. programming interface doesn't use any fancy data structures, so you
  827. should have no problems with other programming languages.
  828.  
  829. The NCP network services are based on channels.  A channel is a
  830. connection between a local and a remote processes.  In the Psion EPOC
  831. environment, a channel is bound to a single process and bears the name
  832. of that process.  AmigaNCP allows you to specify arbitrary names for
  833. your channels, along with having multiple channels within a single
  834. application, if you wish to do so.
  835.  
  836. A channel may be opened in either active or passive mode.  An
  837. active channel attempts to connect to a remote process with a given name
  838. and refuses to open if the remote process doesn't exists or already is
  839. busy with some other connection.  A passive channel just sits around
  840. awaiting a connection from the remote site.  Passive channels are
  841. normally used for server applications awaiting connections from their
  842. clients, whereas active channels are used by clients to contact their
  843. server application.
  844.  
  845. I/O via NCP is done either synchronously or asynchronously.  The
  846. I/O interface of the amigancp.library is quite similar to the EXEC
  847. device I/O interface.  See the function descriptions of the NCP I/O
  848. functions for more details.
  849.  
  850. The Developer/Source/ drawer provides some examples to show the use
  851. of the
  852.     amigancp.library calls.
  853.  
  854. Function Reference
  855. ==================
  856.  
  857. Note that this function reference is also available in standard Amiga
  858. Autodoc format (Developer/Autodocs/ncp.doc).
  859.  
  860. The amigancp.library also contains a clone set of the exec.library
  861. memory pool functions which do work with AmigaOS 2.x systems. The the
  862. exec.library documentation for more information about these functions.
  863.  
  864. NCP_CloseChannel
  865. ----------------
  866.  
  867.         NAME
  868.          NCP_CloseChannel -- close an NCP channel
  869.      
  870.         SYNOPSIS
  871.          NCP_CloseChannel( channel )
  872.                             A0
  873.      
  874.         void NCP_CloseChannel( APTR );
  875.      
  876.         FUNCTION
  877.          Close a NCP channel previously opened by NCP_OpenChannel().
  878.          If this is an active link to the remote machine, it will be
  879.          closed.
  880.      
  881.         INPUTS
  882.          channel -- channel to close. May be NULL, in which case
  883.                     this functions does nothing.
  884.      
  885.         RESULT
  886.          None.
  887.      
  888.         EXAMPLE
  889.      
  890.         NOTES
  891.          An active NCP connection will be dropped about 10s
  892.          after the last channel has been closed.
  893.      
  894.         BUGS
  895.          None known.
  896.      
  897.         SEE ALSO
  898.          NCP_OpenChannel()
  899.  
  900. NCP_OpenChannel
  901. ---------------
  902.  
  903.         NAME
  904.          NCP_OpenChannel -- open an NCP channel to attempt to connect to
  905.                            the remote.
  906.      
  907.         SYNOPSIS
  908.          channel = NCP_OpenChannel( localname, remotename, flags )
  909.            D0                          A0          A1        D0
  910.      
  911.          APTR NCP_OpenChannel( STRPTR, STRPTR, ULONG );
  912.      
  913.         FUNCTION
  914.          Opens an NCP channel. If remotename is not NULL, attempts
  915.          to connect to the remote process and fails with a NULL
  916.          return if the connection could not be made. If remotename
  917.          is NULL, creates a passive channel silently awaiting remote
  918.          connection.
  919.      
  920.         INPUTS
  921.          localname -- name of local "process"
  922.          remotename -- either NULL for a passive channel or
  923.                        the remote process name which to connect
  924.                        to
  925.          flags -- currently unused, leave at 0
  926.      
  927.         RESULT
  928.          channel -- pointer to a channel object. NULL in case of
  929.                     an error, whereas additional error information
  930.                     can be found in IoErr()
  931.      
  932.         EXAMPLE
  933.          To connect to the remote file server:
  934.      
  935.             APTR channel;
  936.             channel = NCP_OpenChannel( "TestHost", "SYS$RFSV.*", 0 );
  937.      
  938.      
  939.         NOTES
  940.          Opening an active channel will result in an attempt to
  941.          create an NCP connection and fail upon any error (including
  942.          serial failure or inexistance of the remote process).
  943.          Creating an passive channel will not cause an NCP connection
  944.          attempt; this is done upon the first I/O request made to
  945.          channel.
  946.      
  947.         BUGS
  948.          None known.
  949.      
  950.         SEE ALSO
  951.          NCP_CloseChannel()
  952.  
  953. NCP_Read
  954. --------
  955.  
  956.         NAME
  957.          NCP_Read -- do a read request.
  958.      
  959.         SYNOPSIS
  960.          status = NCP_Read( channel, data, datasize )
  961.            D0                     A0
  962.      
  963.          LONG NCP_Read( APTR, APTR, ULONG );
  964.      
  965.         FUNCTION
  966.          This is basically identical to calling NCP_BeginRead()
  967.          followed by NCP_WaitRead().
  968.      
  969.         INPUTS
  970.          channel -- a NCP channel created by NCP_OpenChannel()
  971.          data -- receive buffer
  972.          datasize -- receive buffer size
  973.      
  974.         RESULT
  975.          status -- number of bytes read or a negative error
  976.                    number.
  977.      
  978.         EXAMPLE
  979.      
  980.         NOTES
  981.      
  982.         BUGS
  983.      
  984.         SEE ALSO
  985.          NCP_WaitRead(), NCP_BeginRead(), NCP_AbortRead(), NCP_CheckRead()
  986.  
  987. NCP_BeginRead
  988. -------------
  989.  
  990.         NAME
  991.          NCP_BeginRead -- start a read request on the NCP channel.
  992.      
  993.         SYNOPSIS
  994.          error = NCP_BeginRead( channel, data, datasize )
  995.            D0                     A0      A1       D0
  996.      
  997.          LONG NCP_BeginRead( APTR, APTR, ULON G);
  998.      
  999.         FUNCTION
  1000.          Queues a read operation on the current NCP channel.
  1001.      
  1002.         INPUTS
  1003.          channel -- a NCP channel created by NCP_OpenChannel()
  1004.          data -- receive buffer
  1005.          datasize -- receive buffer size
  1006.      
  1007.         RESULT
  1008.          error -- either 0 if the read was queued successfully
  1009.                   or a negative error number
  1010.      
  1011.         EXAMPLE
  1012.      
  1013.         NOTES
  1014.          Only one read request may be queued at a time on a single
  1015.          channel. This function fails with NCPE_INUSE if there is
  1016.          already a read request outstanding.
  1017.      
  1018.         BUGS
  1019.          None known.
  1020.      
  1021.         SEE ALSO
  1022.          NCP_Read(), NCP_WaitRead(), NCP_AbortRead(), NCP_CheckRead()
  1023.  
  1024. NCP_AbortRead
  1025. -------------
  1026.  
  1027.         NAME
  1028.          NCP_AbortRead -- abort read currently in progress
  1029.      
  1030.         SYNOPSIS
  1031.          NCP_AbortRead( channel )
  1032.                           A0
  1033.      
  1034.          void NCP_AbortRead( APTR )
  1035.      
  1036.         FUNCTION
  1037.          Aborts the current read request on the given NCP channel.
  1038.          Does nothing if no read is pending.
  1039.      
  1040.         INPUTS
  1041.          channel -- a NCP channel created by NCP_OpenChannel()
  1042.      
  1043.         RESULT
  1044.          None.
  1045.      
  1046.         EXAMPLE
  1047.      
  1048.         NOTES
  1049.          Never forget to finish a read request using NCP_WaitRead(),
  1050.          or you'll end up in OS hell.
  1051.      
  1052.         BUGS
  1053.          None known.
  1054.      
  1055.         SEE ALSO
  1056.          NCP_Read(), NCP_WaitRead(), NCP_CheckRead(), NCP_BeginRead()
  1057.  
  1058. NCP_CheckRead
  1059. -------------
  1060.  
  1061.         NAME
  1062.          NCP_CheckRead -- check if a read request is still pending
  1063.      
  1064.         SYNOPSIS
  1065.          status = NCP_CheckRead( channel )
  1066.            D0                       A0
  1067.      
  1068.          LONG NCP_CheckRead( APTR )
  1069.      
  1070.         FUNCTION
  1071.          Check if a read request is still pending on the given NCP
  1072.          channel.
  1073.      
  1074.         INPUTS
  1075.          channel -- a NCP channel created by NCP_OpenChannel()
  1076.      
  1077.         RESULT
  1078.          status -- FALSE if a read is currently pending,
  1079.                    TRUE if no request is pending or the current
  1080.                    request has completed.
  1081.      
  1082.         EXAMPLE
  1083.      
  1084.         NOTES
  1085.          Never forget to finish a read request using NCP_WaitRead(),
  1086.          or you'll end up in OS hell.
  1087.      
  1088.         BUGS
  1089.          None known.
  1090.      
  1091.         SEE ALSO
  1092.          NCP_Read(), NCP_WaitRead(), NCP_AbortRead(), NCP_BeginRead()
  1093.  
  1094. NCP_WaitRead
  1095. ------------
  1096.  
  1097.         NAME
  1098.          NCP_WaitRead -- complete a read request on the NCP channel.
  1099.      
  1100.         SYNOPSIS
  1101.          result = NCP_WaitRead( channel )
  1102.            D0                     A0
  1103.      
  1104.          LONG NCP_WaitRead( APTR );
  1105.      
  1106.         FUNCTION
  1107.          Waits for the current read request to finish and
  1108.          returns the result.
  1109.      
  1110.         INPUTS
  1111.          channel -- a NCP channel created by NCP_OpenChannel()
  1112.      
  1113.         RESULT
  1114.          status -- number of bytes read or a negative error
  1115.                    number.
  1116.      
  1117.         EXAMPLE
  1118.      
  1119.         NOTES
  1120.          Every read request startet with NCP_BeginRead() absolutely
  1121.          must be followed by a NCP_WaitRead(), even if it already
  1122.          finished or was aborted via NCP_AbortRead().
  1123.      
  1124.         BUGS
  1125.          Calling this function without an queued read request
  1126.          will hang up your process.
  1127.      
  1128.         SEE ALSO
  1129.          NCP_Read(), NCP_BeginRead(), NCP_AbortRead(), NCP_CheckRead()
  1130.  
  1131. NCP_ReadSig
  1132. -----------
  1133.  
  1134.         NAME
  1135.          NCP_ReadSig -- return signal mask of channel read port.
  1136.      
  1137.         SYNOPSIS
  1138.          sigmask = NCP_ReadSig( channel )
  1139.            D0                     A0
  1140.      
  1141.          ULONG NCP_ReadSig( APTR );
  1142.      
  1143.         FUNCTION
  1144.          This function returns the signal mask of the read port
  1145.          of the given NCP channel. This signal is set if a read
  1146.          request completes.
  1147.      
  1148.         INPUTS
  1149.          channel -- a NCP channel created by NCP_OpenChannel()
  1150.      
  1151.         RESULT
  1152.          sigmask -- signal mask of read port.
  1153.      
  1154.         EXAMPLE
  1155.      
  1156.         NOTES
  1157.          Note that this function returns a signal mask, not a signal bit number.
  1158.      
  1159.         BUGS
  1160.      
  1161.         SEE ALSO
  1162.          NCP_BeginRead()
  1163.  
  1164. NCP_Write
  1165. ---------
  1166.  
  1167.         NAME
  1168.          NCP_Write -- do a write request.
  1169.      
  1170.         SYNOPSIS
  1171.          status = NCP_Write( channel, data, datasize )
  1172.            D0                   A0     A1      D0
  1173.      
  1174.          LONG NCP_Write( APTR, APTR, ULONG );
  1175.      
  1176.         FUNCTION
  1177.          This is basically identical to calling NCP_BeginWrite()
  1178.          followed by NCP_WaitWrite().
  1179.      
  1180.         INPUTS
  1181.          channel -- a NCP channel created by NCP_OpenChannel()
  1182.          data -- receive buffer
  1183.          datasize -- receive buffer size
  1184.      
  1185.         RESULT
  1186.          status -- number of bytes written or a negative error
  1187.                    number.
  1188.      
  1189.         EXAMPLE
  1190.      
  1191.         NOTES
  1192.      
  1193.         BUGS
  1194.      
  1195.         SEE ALSO
  1196.          NCP_WaitWrite(), NCP_BeginWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1197.  
  1198. NCP_BeginWrite
  1199. --------------
  1200.  
  1201.         NAME
  1202.          NCP_BeginWrite -- start a write request on the NCP channel.
  1203.      
  1204.         SYNOPSIS
  1205.          error = NCP_BeginWrite( channel, data, datasize )
  1206.            D0                     A0      A1       D0
  1207.      
  1208.          LONG NCP_BeginWrite( APTR, APTR, ULON G);
  1209.      
  1210.         FUNCTION
  1211.          Queues a write operation on the current NCP channel.
  1212.      
  1213.         INPUTS
  1214.          channel -- a NCP channel created by NCP_OpenChannel()
  1215.          data -- data buffer
  1216.          datasize -- data buffer size
  1217.      
  1218.         RESULT
  1219.          error -- either 0 if the write was queued successfully
  1220.                   or a negative error number
  1221.      
  1222.         EXAMPLE
  1223.      
  1224.         NOTES
  1225.          Only one write request may be queued at a time on a single
  1226.          channel. This function fails with NCPE_INUSE if there is
  1227.          already a write request outstanding.
  1228.      
  1229.         BUGS
  1230.          None known.
  1231.      
  1232.         SEE ALSO
  1233.          NCP_Write(), NCP_WaitWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1234.  
  1235. NCP_AbortWrite
  1236. --------------
  1237.  
  1238.         NAME
  1239.          NCP_AbortWrite -- abort write currently in progress
  1240.      
  1241.         SYNOPSIS
  1242.          NCP_AbortWrite( channel )
  1243.                           A0
  1244.      
  1245.          void NCP_AbortWrite( APTR )
  1246.      
  1247.         FUNCTION
  1248.          Aborts the current write request on the given NCP channel.
  1249.          Does nothing if no write is pending.
  1250.      
  1251.         INPUTS
  1252.          channel -- a NCP channel created by NCP_OpenChannel()
  1253.      
  1254.         RESULT
  1255.          None.
  1256.      
  1257.         EXAMPLE
  1258.      
  1259.         NOTES
  1260.          Never forget to finish a write request using NCP_WaitWrite(),
  1261.          or you'll end up in OS hell.
  1262.      
  1263.         BUGS
  1264.          None known.
  1265.      
  1266.         SEE ALSO
  1267.          NCP_Write(), NCP_WaitWrite(), NCP_CheckWrite(), NCP_BeginWrite()
  1268.  
  1269. NCP_CheckWrite
  1270. --------------
  1271.  
  1272.         NAME
  1273.          NCP_CheckWrite -- check if a write request is still pending
  1274.      
  1275.         SYNOPSIS
  1276.          status = NCP_CheckWrite( channel )
  1277.            D0                       A0
  1278.      
  1279.          LONG NCP_CheckWrite( APTR )
  1280.      
  1281.         FUNCTION
  1282.          Check if a write request is still pending on the given NCP
  1283.          channel.
  1284.      
  1285.         INPUTS
  1286.          channel -- a NCP channel created by NCP_OpenChannel()
  1287.      
  1288.         RESULT
  1289.          status -- FALSE if a write is currently pending,
  1290.                    TRUE if no request is pending or the current
  1291.                    request has completed.
  1292.      
  1293.         EXAMPLE
  1294.      
  1295.         NOTES
  1296.          Never forget to finish a write request using NCP_WaitWrite(),
  1297.          or you'll end up in OS hell.
  1298.      
  1299.         BUGS
  1300.          None known.
  1301.      
  1302.         SEE ALSO
  1303.          NCP_Write(), NCP_WaitWrite(), NCP_AbortWrite(), NCP_BeginWrite()
  1304.  
  1305. NCP_WaitWrite
  1306. -------------
  1307.  
  1308.         NAME
  1309.          NCP_WaitWrite -- complete a write request on the NCP channel.
  1310.      
  1311.         SYNOPSIS
  1312.          result = NCP_WaitWrite( channel )
  1313.            D0                     A0
  1314.      
  1315.          LONG NCP_WaitWrite( APTR );
  1316.      
  1317.         FUNCTION
  1318.          Waits for the current write request to finish and
  1319.          returns the result.
  1320.      
  1321.         INPUTS
  1322.          channel -- a NCP channel created by NCP_OpenChannel()
  1323.      
  1324.         RESULT
  1325.          status -- number of bytes written or a negative error
  1326.                    number.
  1327.      
  1328.         EXAMPLE
  1329.      
  1330.         NOTES
  1331.          Every write request startet with NCP_BeginWrite() absolutely
  1332.          must be followed by a NCP_WaitWrite(), even if it already
  1333.          finished or was aborted via NCP_AbortWrite().
  1334.      
  1335.         BUGS
  1336.          Calling this function without an queued write request
  1337.          will hang up your process.
  1338.      
  1339.         SEE ALSO
  1340.          NCP_Write(), NCP_BeginWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1341.  
  1342. NCP_WriteSig
  1343. ------------
  1344.  
  1345.         NAME
  1346.          NCP_WriteSig -- return signal mask of channel write port.
  1347.      
  1348.         SYNOPSIS
  1349.          sigmask = NCP_WriteSig( channel )
  1350.            D0                     A0
  1351.      
  1352.          ULONG NCP_WriteSig( APTR );
  1353.      
  1354.         FUNCTION
  1355.          This function returns the signal mask of the write port
  1356.          of the given NCP channel. This signal is set if a write
  1357.          request completes.
  1358.      
  1359.         INPUTS
  1360.          channel -- a NCP channel created by NCP_OpenChannel()
  1361.      
  1362.         RESULT
  1363.          sigmask -- signal mask of write port.
  1364.      
  1365.         EXAMPLE
  1366.      
  1367.         NOTES
  1368.          Note that this function returns a signal mask, not a signal bit number.
  1369.      
  1370.         BUGS
  1371.      
  1372.         SEE ALSO
  1373.          NCP_BeginWrite()
  1374.  
  1375. NCP_Fault
  1376. ---------
  1377.  
  1378.         NAME
  1379.          NCP_Fault -- return localized NCP error string
  1380.      
  1381.         SYNOPSIS
  1382.          NCP_Fault( code, header, buffer, buffersize );
  1383.                     D0     A0      A1        D1
  1384.      
  1385.         void NCP_Fault( LONG, STRPTR, STRPTR, ULONG );
  1386.      
  1387.         FUNCTION
  1388.          Returns a localized text string associated with the
  1389.          error code.
  1390.      
  1391.         INPUTS
  1392.          code -- NCP error code
  1393.          header -- header to insert before string. May be NULL
  1394.          buffer -- buffer to write the error text to
  1395.          buffersize -- size of buffer
  1396.      
  1397.         RESULT
  1398.          None.
  1399.      
  1400.         EXAMPLE
  1401.      
  1402.         NOTES
  1403.      
  1404.         BUGS
  1405.          None known.
  1406.      
  1407.         SEE ALSO
  1408.          dos.library/Fault()
  1409.  
  1410. NCP_LinkRemoteRun
  1411. -----------------
  1412.  
  1413.         NAME
  1414.          NCP_LinkRemoteRun -- use the NCP link channel to run a program on
  1415.                               the remote machine.
  1416.      
  1417.         SYNOPSIS
  1418.          error = NCP_LinkRemoteRun( filename, cmdline, cmdlinelen )
  1419.          D0                            A0       A1        D0
  1420.      
  1421.         LONG NCP_LinkRemoteRun( STRPTR, APTR, ULONG );
  1422.      
  1423.         FUNCTION
  1424.          Use the LINK supervisor channel to have the remote link
  1425.          run a program. No NCP channel needs to be opened in order
  1426.          to perform this operation.
  1427.      
  1428.         INPUTS
  1429.          filename -- file name of the remote program to start
  1430.          cmdline -- pointer to command line array. Note that
  1431.                     EPOC command lines are *NOT* zero terminated.
  1432.          cmdlinelen -- length of command line in bytes. May be
  1433.                        zero, in which case no command line
  1434.                        is transfered.
  1435.      
  1436.         RESULT
  1437.          error -- either an AmigaNCP specific error code or the
  1438.                   result code from the remote link.
  1439.      
  1440.         EXAMPLE
  1441.          Have WORD.APP read the Amiga startup sequence:
  1442.      
  1443.             UBYTE cmdline[] = {
  1444.              "OANCPTest\000 V TES\000REM::SYS:\S\STARTUP-SEQUENCE\000"
  1445.             };
  1446.             error = NCP_LinkRemoteRun( "WORD.APP", cmdline, sizeof( cmdline ) );
  1447.      
  1448.         NOTES
  1449.          See the Psion SDK for more information about using commandlines and
  1450.          the LINK process launch feature.
  1451.      
  1452.         BUGS
  1453.          None known.
  1454.      
  1455.         SEE ALSO
  1456.  
  1457. NCP_clnl
  1458. --------
  1459.  
  1460.         NAME
  1461.          NCP_clnl -- clear CR/LF at end of line.
  1462.      
  1463.         SYNOPSIS
  1464.          NCP_clnl( string )
  1465.                    A0
  1466.      
  1467.          void NCP_clnl( STRPTR );
  1468.      
  1469.         FUNCTION
  1470.          Clears any CR or LF characters at the end of the string.
  1471.      
  1472.         INPUTS
  1473.          string -- pointer to string (contents will be modified)
  1474.      
  1475.         RESULT
  1476.          None.
  1477.      
  1478.         EXAMPLE
  1479.      
  1480.         NOTES
  1481.      
  1482.         BUGS
  1483.          None known.
  1484.      
  1485.         SEE ALSO
  1486.  
  1487. NCP_ibm2iso
  1488. -----------
  1489.  
  1490.         NAME
  1491.          NCP_ibm2iso -- convert IBM to ISO charachter
  1492.      
  1493.         SYNOPSIS
  1494.          isochar = NCP_ibm2iso( ibmchar )
  1495.            D0                    D0 0:7
  1496.      
  1497.          UBYTE NCP_ibm2iso( UBYTE );
  1498.      
  1499.         FUNCTION
  1500.          Converts a character from the IBM to the ISO charset.
  1501.      
  1502.         INPUTS
  1503.          ibmchar -- character of the IBM codeset
  1504.      
  1505.         RESULT
  1506.          isochar -- equivalent character in the ISO codeset
  1507.      
  1508.         EXAMPLE
  1509.      
  1510.         NOTES
  1511.      
  1512.         BUGS
  1513.          None known.
  1514.      
  1515.         SEE ALSO
  1516.  
  1517. NCP_tab_ibm2iso
  1518. ---------------
  1519.  
  1520.         NAME
  1521.          NCP_tab_ibm2iso -- returns pointer to internal ibm2iso tab
  1522.      
  1523.         SYNOPSIS
  1524.          tab = NCP_tab_ibm2iso()
  1525.          D0/A0
  1526.      
  1527.          UBYTE *NCP_tab_ibm2iso( void );
  1528.      
  1529.         FUNCTION
  1530.          Returns a pointer to the internal ibm2iso conversion table.
  1531.          This allows you to do more efficient conversion.
  1532.      
  1533.         INPUTS
  1534.          None.
  1535.      
  1536.         RESULT
  1537.          tab -- pointer to 256 byte conversion table.
  1538.      
  1539.         EXAMPLE
  1540.      
  1541.         NOTES
  1542.          The pointer is returned both in D0 and A0.
  1543.      
  1544.         BUGS
  1545.          None known.
  1546.      
  1547.         SEE ALSO
  1548.  
  1549. NCP_tab_iso2ibm
  1550. ---------------
  1551.  
  1552.         NAME
  1553.          NCP_tab_iso2ibm -- returns pointer to internal iso2ibm tab
  1554.      
  1555.         SYNOPSIS
  1556.          tab = NCP_tab_iso2ibm()
  1557.          D0/A0
  1558.      
  1559.          UBYTE *NCP_tab_iso2ibm( void );
  1560.      
  1561.         FUNCTION
  1562.          Returns a pointer to the internal ISO2IBM conversion table.
  1563.          This allows you to do more efficient conversion.
  1564.      
  1565.         INPUTS
  1566.          None.
  1567.      
  1568.         RESULT
  1569.          tab -- pointer to 256 byte conversion table.
  1570.      
  1571.         EXAMPLE
  1572.      
  1573.         NOTES
  1574.          The pointer is returned both in D0 and A0.
  1575.      
  1576.         BUGS
  1577.          None known.
  1578.      
  1579.         SEE ALSO
  1580.  
  1581. NCP_iso2ibm
  1582. -----------
  1583.  
  1584.         NAME
  1585.          NCP_iso2ibm -- convert IBM to ISO charachter
  1586.      
  1587.         SYNOPSIS
  1588.          ibmchar = NCP_iso2ibm( isochar )
  1589.            D0                    D0 0:7
  1590.      
  1591.          UBYTE NCP_iso2ibm( UBYTE );
  1592.      
  1593.         FUNCTION
  1594.          Converts a character from the ISO to the IBM charset.
  1595.      
  1596.         INPUTS
  1597.          isochar -- character of the ISO codeset
  1598.      
  1599.         RESULT
  1600.          ibmchar -- equivalent character in the IBM codeset
  1601.      
  1602.         EXAMPLE
  1603.      
  1604.         NOTES
  1605.      
  1606.         BUGS
  1607.          None known.
  1608.      
  1609.         SEE ALSO
  1610.  
  1611. NCP_IWORD
  1612. ---------
  1613.  
  1614.         NAME
  1615.          NCP_IWORD -- swap bytes in word
  1616.      
  1617.         SYNOPSIS
  1618.          sword = NCP_IWORD( word )
  1619.            D0                D0
  1620.      
  1621.          UWORD NCP_IWORD( UWORD );
  1622.      
  1623.         FUNCTION
  1624.          Swaps the byte order within the word.
  1625.      
  1626.         INPUTS
  1627.          word -- a 16 bit data word.
  1628.      
  1629.         RESULT
  1630.          sword -- the same word with the byte order swapped.
  1631.      
  1632.         EXAMPLE
  1633.      
  1634.         NOTES
  1635.      
  1636.         BUGS
  1637.          None known.
  1638.      
  1639.         SEE ALSO
  1640.  
  1641. NCP_IWORDP
  1642. ----------
  1643.  
  1644.         NAME
  1645.          NCP_IWORDP -- swap bytes in word (pointer version)
  1646.      
  1647.         SYNOPSIS
  1648.          sword = NCP_IWORDP( wordp1, wordp2 )
  1649.            D0                  A0      A1
  1650.      
  1651.          UWORD NCP_IWORDP( UWORD *, UWORD * );
  1652.      
  1653.         FUNCTION
  1654.          Swaps the byte order from the word pointed to by wordp1
  1655.          and places the result in the word pointed to by wordp2.
  1656.      
  1657.         INPUTS
  1658.          wordp1 -- pointer to source word
  1659.          wordp2 -- pointer to destination word
  1660.      
  1661.         RESULT
  1662.          sword -- the same word with the byte order swapped.
  1663.      
  1664.         EXAMPLE
  1665.      
  1666.         NOTES
  1667.          The words don't need to be word aligned.
  1668.      
  1669.         BUGS
  1670.          The 68020++ version of amigancp.library requires the hardware
  1671.          to be able to do misaligned word accesses. Some early
  1672.          accelerator boards may have problems doing this.
  1673.      
  1674.         SEE ALSO
  1675.  
  1676. NCP_IWORDPI
  1677. -----------
  1678.  
  1679.         NAME
  1680.          NCP_IWORDPI -- swap bytes in word (in-place pointer version)
  1681.      
  1682.         SYNOPSIS
  1683.          sword = NCP_IWORDPI( wordp1 )
  1684.            D0                   A0
  1685.      
  1686.          UWORD NCP_IWORDP( UWORD * )
  1687.      
  1688.         FUNCTION
  1689.          Swaps the byte order within the word pointed to by wordp.
  1690.      
  1691.         INPUTS
  1692.          wordp -- pointer to word to swap
  1693.      
  1694.         RESULT
  1695.          sword -- the same word with the byte order swapped.
  1696.      
  1697.         EXAMPLE
  1698.      
  1699.         NOTES
  1700.          The word doesn't need to be word aligned.
  1701.      
  1702.         BUGS
  1703.          The 68020++ version of amigancp.library requires the hardware
  1704.          to be able to do misaligned word accesses. Some early
  1705.          accelerator boards may have problems doing this.
  1706.      
  1707.         SEE ALSO
  1708.  
  1709. NCP_ILONG
  1710. ---------
  1711.  
  1712.         NAME
  1713.          NCP_ILONG -- swap bytes in longword
  1714.      
  1715.         SYNOPSIS
  1716.          slongword = NCP_ILONG( longword )
  1717.            D0                     D0
  1718.      
  1719.          ULONG NCP_ILONG( ULONG );
  1720.      
  1721.         FUNCTION
  1722.          Swaps the byte order within the longword.
  1723.      
  1724.         INPUTS
  1725.          longword -- a 32 bit data word.
  1726.      
  1727.         RESULT
  1728.          slongword -- the same word with the byte order swapped.
  1729.      
  1730.         EXAMPLE
  1731.      
  1732.         NOTES
  1733.      
  1734.         BUGS
  1735.          None known.
  1736.      
  1737.         SEE ALSO
  1738.  
  1739. NCP_ILONGP
  1740. ----------
  1741.  
  1742.         NAME
  1743.          NCP_ILONGP -- swap bytes in longword (pointer version)
  1744.      
  1745.         SYNOPSIS
  1746.          sword = NCP_ILONGP( longwordp1, longwordp2 )
  1747.            D0                    A0          A1
  1748.      
  1749.          ULONG NCP_ILONGP( ULONG *, ULONG * );
  1750.      
  1751.         FUNCTION
  1752.          Swaps the byte order from the longword pointed to by longwordp1
  1753.          and places the result in the longword pointed to by longwordp2.
  1754.      
  1755.         INPUTS
  1756.          longwordp1 -- pointer to source longword
  1757.          longwordp2 -- pointer to destination longword
  1758.      
  1759.         RESULT
  1760.          sword -- the same word with the byte order swapped.
  1761.      
  1762.         EXAMPLE
  1763.      
  1764.         NOTES
  1765.          The longwords don't need to be word aligned.
  1766.      
  1767.         BUGS
  1768.          The 68020++ version of amigancp.library requires the hardware
  1769.          to be able to do misaligned word accesses. Some early
  1770.          accelerator boards may have problems doing this.
  1771.      
  1772.         SEE ALSO
  1773.  
  1774. NCP_ILONGPI
  1775. -----------
  1776.  
  1777.         NAME
  1778.          NCP_ILONGPI -- swap bytes in longword (in-place pointer version)
  1779.      
  1780.         SYNOPSIS
  1781.          sword = NCP_ILONGPI( longwordp )
  1782.            D0                    A0
  1783.      
  1784.          ULONG NCP_ILONGP( ULONG * )
  1785.      
  1786.         FUNCTION
  1787.          Swaps the byte order within the longword pointed to by longwordp.
  1788.      
  1789.         INPUTS
  1790.          longwordp -- pointer to longword to swap
  1791.      
  1792.         RESULT
  1793.          sword -- the same word with the byte order swapped.
  1794.      
  1795.         EXAMPLE
  1796.      
  1797.         NOTES
  1798.          The longword doesn't need to be word aligned.
  1799.      
  1800.         BUGS
  1801.          The 68020++ version of amigancp.library requires the hardware
  1802.          to be able to do misaligned word accesses. Some early
  1803.          accelerator boards may have problems doing this.
  1804.      
  1805.         SEE ALSO
  1806.  
  1807. Error codes from NCP functions
  1808. ==============================
  1809.  
  1810. Several amigancp.library functions may return negative error
  1811. numbers.  Note that besides the errors internal to
  1812. amigancp.library, standard EPOC OS errors may be returned by some
  1813. functions.
  1814.  
  1815. NCPE_INUSE (-1)
  1816.      There is already a read/write request pending on the given channel.
  1817.  
  1818. NCPE_ABORTED (-2)
  1819.      The read/write request has been aborted by NCP_AbortXXX()
  1820.  
  1821. NCPE_OFFLINE (-3)
  1822.      There is no NCP connection.  This may denote that the remote NCP
  1823.      closed the connection.
  1824.  
  1825. NCPE_INACTIVE (-4)
  1826.      The channel is currently inactive.  Most likely it has been closed
  1827.      by the remote process, or the NCP connection is currently dropped
  1828.      due to serial link failure.
  1829.  
  1830. NCPE_NOTFOUND (-5)
  1831.      You attempted to open an active channel and the remote process
  1832.      didn't exist.
  1833.  
  1834. NCPE_RECONNECTED (-6)
  1835.      This is not really an error.  Queued read requests will be
  1836.      terminated with this error value if the NCP connection has been
  1837.      succesfully reconnected.
  1838.  
  1839. NCPE_NEWUSER (-7)
  1840.      This is not really an error.  It may come up if the remote client
  1841.      of a passive channel changed.
  1842.  
  1843. Index
  1844. *****
  1845.  
  1846.  
  1847.  
  1848.  NCP.config                             Using AmigaNCP
  1849.  AmigaNCP File Server                   File Server
  1850.  AmigaNCP File System                   File System
  1851.  amigancp.library calls                 API
  1852.  amigancp.library functions             API
  1853.  API                                    API
  1854.  error codes                            Errors
  1855.  File Server options                    File Server
  1856.  File System Options                    File System
  1857.  function calls                         API
  1858.  Installation                           Using AmigaNCP
  1859.  Installing AmigaNCP                    Using AmigaNCP
  1860.  Introduction                           Introduction
  1861.  Monitor                                AmigaNCP-Monitor
  1862.  NCP errors                             Errors
  1863.  NCP-Monitor                            AmigaNCP-Monitor
  1864.  NCP_AbortRead                          NCP_AbortRead
  1865.  NCP_AbortWrite                         NCP_AbortWrite
  1866.  NCP_BeginRead                          NCP_BeginRead
  1867.  NCP_BeginWrite                         NCP_BeginWrite
  1868.  NCP_CheckRead                          NCP_CheckRead
  1869.  NCP_CheckWrite                         NCP_CheckWrite
  1870.  NCP_clnl                               NCP_clnl
  1871.  NCP_CloseChannel                       NCP_CloseChannel
  1872.  NCP_Fault                              NCP_Fault
  1873.  NCP_ibm2iso                            NCP_ibm2iso
  1874.  NCP_ILONG                              NCP_ILONG
  1875.  NCP_ILONGP                             NCP_ILONGP
  1876.  NCP_ILONGPI                            NCP_ILONGPI
  1877.  NCP_iso2ibm                            NCP_iso2ibm
  1878.  NCP_IWORD                              NCP_IWORD
  1879.  NCP_IWORDP                             NCP_IWORDP
  1880.  NCP_IWORDPI                            NCP_IWORDPI
  1881.  NCP_LinkRemoteRun                      NCP_LinkRemoteRun
  1882.  NCP_OpenChannel                        NCP_OpenChannel
  1883.  NCP_Read                               NCP_Read
  1884.  NCP_ReadSig                            NCP_ReadSig
  1885.  NCP_tab_ibm2iso                        NCP_tab_ibm2iso
  1886.  NCP_tab_iso2ibm                        NCP_tab_iso2ibm
  1887.  NCP_WaitRead                           NCP_WaitRead
  1888.  NCP_WaitWrite                          NCP_WaitWrite
  1889.  NCP_Write                              NCP_Write
  1890.  NCP_WriteSig                           NCP_WriteSig
  1891.  Network Monitor                        AmigaNCP-Monitor
  1892.  Options, File Server                   File Server
  1893.  Options, File System                   File System
  1894.  Other Tools                            Other Tools
  1895.  Parts                                  Introduction
  1896.  Remote File Server                     File Server
  1897.  Remote File System                     File System
  1898.  S3PrintServer                          S3PrintServer
  1899.  S3Run                                  S3Run
  1900.  serial configuration                   Using AmigaNCP
  1901.  serial.device, configuration of        Using AmigaNCP
  1902.  
  1903.